#include <cmath>
#include <glm/glm.hpp>

#ifndef VECTOR3
#define VECTOR3
class Vector3
{
	public:
	float x,y,z;
	float xyz[3];
	Vector3(float x_in, float y_in, float z_in): x(x_in), y(y_in), z(z_in){}
	Vector3() {x = y = z = 0.0f;}
	inline Vector3 operator*(const Vector3& v){return Vector3(v.x * x, v.y*y, v.z*z);}
	inline Vector3 operator*(float f){return Vector3(f * x, f*y, f*z);}
	inline Vector3 operator+(const Vector3& v){return Vector3(v.x + x, v.y + y, v.z + z);}
	inline Vector3 operator-(const Vector3& v){return Vector3(v.x - x, v.y - y, v.z - z);}
	inline float Dot(const Vector3& v){return v.x * x + v.y * y + v.z * z;}
	inline float Length(){return sqrtf(Square());}
	inline float Square(){return x*x + y*y + z*z;}
	inline Vector3 Cross(const Vector3& v){return Vector3(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x);}
	inline Vector3 Norm(){float length = Length(); return Vector3(x / length, y / length, z / length);}
	inline glm::vec3 ToGLMVector(){return glm::vec3(x, y, z);}
	float* ToFloatArray(){xyz[0] = x; xyz[1] = y; xyz[2] = z; return xyz;}
};

#endif
